<template>
    <div class="msj_nav">
        <el-button :type="current==index?'warning':'text'" style="width: 80px;" v-for="(item,index) in navlist" @click="handel(item,index)" size="small" :key="index">{{ item.name }}</el-button>
    </div>
</template>

<script>
export default {
    name: 'PhaemacyHuodongnav',
    props:['navlist'],
    data() {
        return {
            current:0
        };
    },

    mounted() {
        this.$bus.$on('getcurr',this.getcur)
    },
    updated(){

    },
    methods: {
        handel(v,i){
            this.current = i;
            this.$emit('onbreadcrumb',{name:v.name,curr:i})
        },
        getcur(v){
            this.current=v.curr
        }
    },
};
</script>

<style  scoped>
    .msj_nav{
        width: 100%;
        border: 1px solid #ddd;
        display: flex; border-radius: 5px;
        box-sizing: border-box;
        padding:5px 10px;
    }
</style>